﻿Imports DTO
Imports BUS
Imports GVariable.Variable
Public Class Form1

    Private nVien As New DTO.CNhanVien()
    Private busNVien As New BUS.CBusiNhanVien()

    Private Sub btnThem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThem.Click
        Dim frmNVCT As New Form2
        frmNVCT.txtMaNV.Text = busNVien.TaoMaNhanVien("NV", "maNV", "nhanvien", 8)
        frmNVCT.txtMaNV.Enabled = False
        frmNVCT.ShowDialog()

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Dim tbNVien As DataTable
        'tbNVien = busNVien.DocBangNhanVien()
        ''MessageBox.Show(intKiemTraKetNoi.ToString)
        ''doc du lieu vao combobox
        'For i = 0 To tbNVien.Rows.Count - 1
        '    cbbTenNhanVien.Items.Add(tbNVien.Rows(i)("hoTenNV"))
        'Next
        'DataGridView1.DataSource = tbNVien

    End Sub

    Private Sub btnXoa_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnXoa.Click
        'Lấy mã nhân viên
        busNVien.XoaNhanVien("NV001")
        If (intKTTruyVan = 1) Then
            '
            'load lại cai bang
            MessageBox.Show("Xóa thành công")
        Else
            MessageBox.Show("Not ok")
        End If
    End Sub

    Private Sub cbbTenNhanVien_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbbTenNhanVien.SelectedIndexChanged

    End Sub

    Private Sub cbbTenNhanVien_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbbTenNhanVien.TextChanged
        'Dim tblNhanVien As DataTable
        'Dim tenNV As String = cbbTenNhanVien.Text
        'tblNhanVien = busNVien.TimKiem("", tenNV)
        'DataGridView1.DataSource = tblNhanVien
    End Sub
End Class
